@section('head')
    <style>
        .layui-form-label {
            width: auto;
        }
        .layui-input-block {
            margin-left: 140px;
            min-height: 36px;
        }
    </style>

@endsection

<div class="layui-card">
    <div class="layui-card-header">基本资料</div>
    <div class="layui-form-item">
        <label class="layui-form-label">院校名称</label>
        <div class="layui-input-block">
            <input type="text" name="name" required  lay-verify="required" placeholder="请填写院校名称" autocomplete="off" value="{{$model->name}}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">省市区</label>
        <div class="layui-input-block">
            <div class="layui-col-sm4">
                <div class="layui-inline layui-select-default" style="width: 99%;">
                    <select name="p_id" data-id="{{$model->p_id}}" lay-filter="p_id" >
                        <option value="">选择省</option>
                    </select>
                </div>
            </div>
            <div class="layui-col-sm4">
                <div class="layui-inline layui-select-default" style="width: 99%;">
                    <select name="c_id" data-id="{{$model->c_id}}" lay-filter="c_id">
                        <option value="">选择市</option>
                    </select>
                </div>
            </div>
            <div class="layui-col-sm4">
                <div class="layui-inline layui-select-default" style="width: 99%;">
                    <select name="r_id" data-id="{{$model->r_id}}" lay-filter="r_id">
                        <option value="">选择区</option>
                    </select>
                </div>
            </div>

        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">院校详细地址</label>
        <div class="layui-input-block">
            <input type="text" name="address" required  lay-verify="required" placeholder="请填写院校详细地址" autocomplete="off" value="{{$model->address}}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">联系人</label>
        <div class="layui-input-block">
            <input type="text" name="person_in_charge" required  lay-verify="required" placeholder="请填写联系人姓名" autocomplete="off" value="{{$model->person_in_charge}}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">联系电话</label>
        <div class="layui-input-block">
            <input type="text" name="contact_phone" required  lay-verify="required" placeholder="请填写联系人电话" autocomplete="off" value="{{$model->contact_phone}}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">客服电话</label>
        <div class="layui-input-block">
            <input type="text" name="cs_phone" required  lay-verify="required" placeholder="请填写客服电话" autocomplete="off" value="{{$model->cs_phone}}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item buyway1_show">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            <input type="radio" name="status" value="1" title="开启" @if(!$model || $model->status==1) checked
                   @endif lay-filter="status">
            <input type="radio" name="status" value="0" title="关闭" @if($model && $model->status==0) checked
                   @endif lay-filter="status">
        </div>
    </div>
</div>
@section('script')
    <script>
        $(function() {
            $.ajax({
                url: '{{route("school.area")}}',
                type: 'GET',
                dateType: 'json',
                success: function (res) {
                    $.rawCitiesData = res.data
                    layui.config({
                        base: '' //假设这是你存放拓展模块的根目录
                    }).extend({ //设定模块别名
                        common: "{{ URL::asset('/static/web/layui_extends/select_area')}}", //如果 common.js 是在根目录，也可以不用设定别名
                    });

                    layui.use(['form', 'common'], function(){
                        var common = layui.common
                        //do something...
                        //三级地址联动
                        common.showCity('p_id', 'c_id', 'r_id');
                    });
                }
            })
        });
    </script>
@endsection